{{ define "syntax1/index.html"}}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>

<h1>模板语法</h1>
{{.name}}
<br>
{{range .arr}}
    {{.}}
    {{$.name}}<br>
{{end}}
<br>
{{range $i,$v := .arr}}
    {{$i}}
    {{$v}} <br>
{{end}}

<br>
{{"JacksonP"}}
<br>
<!-- ascll码对应-->
{{'a'}} {{'A'}}
<br>
<!--原始字符串-->
{{`hello gin`}}
<br>
{{print "gin"}}
<br>
{{print nil}}
<br>
{{$name :="jack"}}
{{$name}} <br> {{$name}} {{$name}} {{$name}}
<br>
{{.name | len}}
<br>
{{if .name}}
    姓名为:{{.name}},欢迎！
{{else}}
    <p>没有姓名</p>
{{end}}
<br>
{{if .name}}
    欢迎:{{.name}}
    {{if .birth}}
        你的生日是:{{.birth}}
    {{end}}
{{else}}
    欢迎游客！！！
{{end}}
<br>
{{range .arr}}
    {{.}}
{{end}}
<br>
{{range $i,$v :=.arr}}
    {{$i}} {{$v}} <br>
{{end}}
<br>
{{range .arr1}}
    {{.}}
{{else}}
<!--       当 . 为空或者 长度为0时 会执行这里   -->
    {{0}} <span>暂无数据</span>
{{end}}
<br>
Id &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; title &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; desc <br>
{{.my_article.Id}} &nbsp;&nbsp;&nbsp; {{.my_article.Title}} &nbsp;&nbsp;&ensp;{{.my_article.Desc}}
<br>
{{with .my_article}}
    {{.Id}}  &nbsp;&nbsp;&nbsp; {{.Title}}  &nbsp;&nbsp;&nbsp; {{.Desc}}
{{end}}
<br>

{{with .my_article345}}
    {{.Id}}  &nbsp;&nbsp;&nbsp; {{.Title}}  &nbsp;&nbsp;&nbsp; {{.Desc}}
{{else}}
    暂无数据
{{end}}
<br>
{{template "syntax1/base.html" .}}
<br>
<!--这是模板注释-->

<br>

</body>
</html>
{{end}}